import { AxiosPromise, AxiosRequestConfig } from 'axios';

export interface InstanceMethod {
  get(url: string, params?: {}, config?: AxiosRequestConfig): AxiosPromise;
  post(url: string, params?: {}, config?: AxiosRequestConfig): AxiosPromise;
  delete(url: string, params?: {}, config?: AxiosRequestConfig): AxiosPromise;
}

export type Method = (params?: {}, config?: AxiosRequestConfig) => AxiosPromise

export interface ApiMethod {
  [key: string]: Method,
}

export interface ModulesApi {
  [key: string]: { request(instanceMethod: InstanceMethod): ApiMethod },
}

export interface Api {
  [key: string]: Method | ApiMethod,
}
